package com.zk.iotgateway.quartz;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.text.SimpleDateFormat;

/**
 * ${DESCRIPTION}
 *
 * @author:mn.m
 * @create 2019-07-08 下午 05:14
 **/
public abstract  class AbstractJob implements Job {



    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        System.out.println("JobDemo1：启动任务=======================");
        run();
        System.out.println("JobDemo1：下次执行时间====="+
                                   new SimpleDateFormat("yyyy-MM-dd hh:mm:ss")
                                           .format(context.getNextFireTime())+"==============");
    }

    public abstract void run();
}
